<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String u= request.getHeader("host");
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String dbid = request.getParameter("dbid");
    String ajbh = request.getParameter("ajbh");
    String rybh = request.getParameter("rybh");
    String sftj = request.getParameter("sftj");
    String sfsq = request.getParameter("sfsq");
    String zjdy = request.getParameter("zjdy");
    String mblb = request.getParameter("mblb");
    String mbid = request.getParameter("mbid");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>${title}</title>
	<link rel="stylesheet" type="text/css" href="<c:url value='/resource/css/common.css'/>"/>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="<c:url value='/resource/js/jquery-1.7.2.min.js'/>"></script>
	<script type="text/javascript" src="<c:url value='/resource/js/jquery.form.js'/>"></script>
	<script type="text/javascript" src="<c:url value='/resource/artdialog/artdialog.js?skin=${sys_theme}'/>"></script>
	<script type="text/javascript" src="<c:url value='/resource/artdialog/iframetools.js'/>"></script>
	
<script >
$(function(){
	if(<%=mblb%>!=10&&<%=mblb%>!=11&&<%=mblb%>!=12){
		$("#sfbc").hide();
	}
	document.getElementById("wordframe").height = $(window).height()-38;
	wordframe.location.href="<%=path%>/common/DocumentEdit.jsp?dbid=<%=dbid%>&zjdy=<%=zjdy%>";
	//分局给奖情况中,查看文件时候,隐藏所有签章按钮
	$("#selSign").hide();
});

function saveWord(status)
{
 wordframe.saveWord('<%=dbid%>','<%=ajbh%>','<%=rybh%>',<%=mbid%>,status);
	//保存本次盖章记录
	////sign_ids
	//刷新之前的页面
	//吸毒检测类
	if('<%=mblb%>'==11){
		opener.location.reload();
	}
	//成瘾认定类
	if('<%=mblb%>'==12){
		opener.location.reload();
	}
	/**
	 * 
	 * @param {Object} sftj
	
		if('<%=mblb%>'==10){
		   alert(opener.location)
			//opener.location.iframe.contentWindow.reload();
		}
	  */
	//刷新本页面
    //reloadPage();
	 close();
	//alert(opener.frames.length)
}

//重新加载界面
function reloadPage(sftj){
//window.location.replace('<%=path%>/common/sign.jsp?dbid=<%=dbid%>&rybh=<%=rybh%>&ajbh=<%=ajbh%>');

  $.post('<%=path%>/flws/getTj.json', {
		                  dbid : '<%=dbid%>'
				          }, function(data) {
		                       window.location.replace('<%=path%>/common/sign.jsp?dbid=<%=dbid%>&sftj='+data.sftj);
				});
  
}


function downWord(u)
{
	window.open(u);
}

function filePrint(){
	wordframe.WebOpenPrint4Single(false);
}


</script>
  </head>
  
  <body style="margin: 0 0 0 0;padding: 0 0 0 0" height="600">
  
    
  
  <div id="region_tools">
  	<a id="sfbc" href="javascript:saveWord('0')">保存</a>
  	<!-- 
  	<a id="sftj" href="javascript:saveWord('1')">提交服务器</a>
  	<a id="sfsq" href="javascript:saveWord('2')" style="display: none;">申请修改</a>
 -->
  	<a id="sftj" href="javascript:filePrint()">打印</a>
  	
  </div>
  <iframe id="wordframe" name="wordframe" width="100%" scrolling="no" height="560" frameborder="0"></iframe>
 
  </body>
</html>
